Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add StringBeforeLast function #1507

Merged

Conversation

f-lapinski
Copy link
Contributor

Fix variable name in two tests

Change Log

Added

  • Add string function BeforeLast with Tests

Fixed

  • Fix some variable names in previous functions tests

Changed

Removed

Deprecated

Security


Description

Returns the contents found before/after the last occurrence of the given string.

Fix variable name in two tests
Copy link
Contributor

github-actions bot commented Mar 2, 2025

Flow PHP - Benchmarks

Results of the benchmarks from this PR are compared with the results from 1.x branch.

Extractors
+-----------------------+-------------------+------+-----+-----------------+------------------+-----------------+
| benchmark             | subject           | revs | its | mem_peak        | mode             | rstdev          |
+-----------------------+-------------------+------+-----+-----------------+------------------+-----------------+
| CSVExtractorBench     | bench_extract_10k | 1    | 3   | 4.849mb +0.02%  | 566.370ms +2.63% | ±1.73% +283.78% |
| JsonExtractorBench    | bench_extract_10k | 1    | 3   | 4.922mb +0.01%  | 1.061s -0.83%    | ±1.25% +78.93%  |
| ParquetExtractorBench | bench_extract_10k | 1    | 3   | 86.375mb +0.00% | 920.961ms +2.84% | ±0.84% +665.29% |
| TextExtractorBench    | bench_extract_10k | 1    | 3   | 4.579mb +0.02%  | 36.448ms +3.52%  | ±0.72% -14.95%  |
| XmlExtractorBench     | bench_extract_10k | 1    | 3   | 4.554mb +0.02%  | 606.258ms +0.49% | ±1.07% +268.55% |
+-----------------------+-------------------+------+-----+-----------------+------------------+-----------------+
Transformers
+-----------------------------+--------------------------+------+-----+------------------+-----------------+-----------------+
| benchmark                   | subject                  | revs | its | mem_peak         | mode            | rstdev          |
+-----------------------------+--------------------------+------+-----+------------------+-----------------+-----------------+
| RenameEntryTransformerBench | bench_transform_10k_rows | 1    | 3   | 127.376mb +0.00% | 72.282ms +1.12% | ±2.91% +267.30% |
+-----------------------------+--------------------------+------+-----+------------------+-----------------+-----------------+
Loaders
+--------------------+----------------+------+-----+------------------+------------------+----------------+
| benchmark          | subject        | revs | its | mem_peak         | mode             | rstdev         |
+--------------------+----------------+------+-----+------------------+------------------+----------------+
| CSVLoaderBench     | bench_load_10k | 1    | 3   | 64.048mb +0.00%  | 103.419ms +1.36% | ±0.52% -62.25% |
| JsonLoaderBench    | bench_load_10k | 1    | 3   | 84.395mb +0.00%  | 98.244ms +1.98%  | ±0.21% -82.58% |
| ParquetLoaderBench | bench_load_10k | 1    | 3   | 161.246mb +0.00% | 21.023s -4.63%   | ±0.60% +57.27% |
| TextLoaderBench    | bench_load_10k | 1    | 3   | 18.111mb +0.00%  | 31.363ms +1.07%  | ±0.50% -68.40% |
+--------------------+----------------+------+-----+------------------+------------------+----------------+
Building Blocks
+-------------------+----------------------------+------+-----+------------------+------------------+-----------------+
| benchmark         | subject                    | revs | its | mem_peak         | mode             | rstdev          |
+-------------------+----------------------------+------+-----+------------------+------------------+-----------------+
| TypeDetectorBench | bench_type_detector        | 1    | 3   | 43.895mb +0.00%  | 359.997ms -0.24% | ±0.68% -70.53%  |
| TypeDetectorBench | bench_type_detector        | 1    | 3   | 11.705mb +0.01%  | 74.632ms +0.25%  | ±0.66% -41.63%  |
| EntryFactoryBench | bench_entry_factory        | 1    | 3   | 105.995mb +0.00% | 452.787ms -0.87% | ±0.85% +304.08% |
| EntryFactoryBench | bench_entry_factory        | 1    | 3   | 55.185mb +0.00%  | 230.486ms +1.01% | ±1.24% +538.22% |
| EntryFactoryBench | bench_entry_factory        | 1    | 3   | 14.707mb +0.01%  | 51.533ms +2.11%  | ±1.72% +738.31% |
| RowsBench         | bench_chunk_10_on_10k      | 2    | 3   | 97.038mb +0.00%  | 4.000ms +20.29%  | ±1.30% -52.57%  |
| RowsBench         | bench_diff_left_1k_on_10k  | 2    | 3   | 114.327mb +0.00% | 183.814ms +0.08% | ±0.93% -4.92%   |
| RowsBench         | bench_diff_right_1k_on_10k | 2    | 3   | 97.047mb +0.00%  | 18.902ms -0.03%  | ±0.48% -43.37%  |
| RowsBench         | bench_drop_1k_on_10k       | 2    | 3   | 97.913mb +0.00%  | 2.045ms +39.95%  | ±1.22% -26.02%  |
| RowsBench         | bench_drop_right_1k_on_10k | 2    | 3   | 97.913mb +0.00%  | 2.021ms +40.80%  | ±1.65% +302.73% |
| RowsBench         | bench_entries_on_10k       | 2    | 3   | 96.074mb +0.00%  | 5.683ms +30.98%  | ±1.90% +512.80% |
| RowsBench         | bench_filter_on_10k        | 2    | 3   | 96.603mb +0.00%  | 17.227ms +5.40%  | ±0.52% -36.51%  |
| RowsBench         | bench_find_on_10k          | 2    | 3   | 96.603mb +0.00%  | 17.278ms +5.92%  | ±0.57% -48.92%  |
| RowsBench         | bench_find_one_on_10k      | 10   | 3   | 95.294mb +0.00%  | 2.006μs +5.92%   | ±2.32% -8.20%   |
| RowsBench         | bench_first_on_10k         | 10   | 3   | 95.294mb +0.00%  | 0.400μs 0.00%    | ±0.00% 0.00%    |
| RowsBench         | bench_flat_map_on_1k       | 2    | 3   | 104.512mb +0.00% | 16.916ms +17.63% | ±2.45% +251.49% |
| RowsBench         | bench_map_on_10k           | 2    | 3   | 134.579mb +0.00% | 74.942ms +7.55%  | ±0.16% -43.44%  |
| RowsBench         | bench_merge_1k_on_10k      | 2    | 3   | 97.122mb +0.00%  | 1.996ms +54.89%  | ±2.55% +8.43%   |
| RowsBench         | bench_partition_by_on_10k  | 2    | 3   | 100.427mb +0.00% | 65.912ms +3.34%  | ±0.19% -82.21%  |
| RowsBench         | bench_remove_on_10k        | 2    | 3   | 98.175mb +0.00%  | 4.305ms +16.34%  | ±2.40% +972.10% |
| RowsBench         | bench_sort_asc_on_1k       | 2    | 3   | 95.589mb +0.00%  | 45.045ms +7.61%  | ±1.28% -47.95%  |
| RowsBench         | bench_sort_by_on_1k        | 2    | 3   | 95.589mb +0.00%  | 45.284ms +7.55%  | ±0.31% -16.36%  |
| RowsBench         | bench_sort_desc_on_1k      | 2    | 3   | 95.589mb +0.00%  | 45.602ms +5.05%  | ±1.14% -36.94%  |
| RowsBench         | bench_sort_entries_on_1k   | 2    | 3   | 97.734mb +0.00%  | 8.699ms +5.70%   | ±0.59% -34.92%  |
| RowsBench         | bench_sort_on_1k           | 2    | 3   | 95.484mb +0.00%  | 31.638ms +8.36%  | ±0.31% -18.97%  |
| RowsBench         | bench_take_1k_on_10k       | 10   | 3   | 95.294mb +0.00%  | 14.782μs +11.71% | ±0.96% -68.71%  |
| RowsBench         | bench_take_right_1k_on_10k | 10   | 3   | 95.294mb +0.00%  | 16.942μs +12.36% | ±1.93% +133.69% |
| RowsBench         | bench_unique_on_1k         | 2    | 3   | 114.328mb +0.00% | 187.852ms -0.95% | ±0.60% -26.18%  |
+-------------------+----------------------------+------+-----+------------------+------------------+-----------------+

Copy link

codecov bot commented Mar 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.05%. Comparing base (7f21302) to head (705e3c8).
Report is 5 commits behind head on 1.x.

Additional details and impacted files
@@            Coverage Diff             @@
##              1.x    #1507      +/-   ##
==========================================
+ Coverage   83.04%   83.05%   +0.01%     
==========================================
  Files         684      685       +1     
  Lines       18302    18315      +13     
==========================================
+ Hits        15198    15212      +14     
+ Misses       3104     3103       -1     
Components Coverage Δ
etl 86.09% <100.00%> (+0.02%) ⬆️
cli 86.73% <ø> (ø)
lib-array-dot 94.53% <ø> (ø)
lib-azure-sdk 62.56% <ø> (ø)
lib-doctrine-dbal-bulk 90.11% <ø> (ø)
lib-filesystem 78.02% <ø> (ø)
lib-parquet 84.33% <ø> (ø)
lib-parquet-viewer 82.02% <ø> (ø)
lib-rdsl 87.09% <ø> (ø)
lib-snappy 91.16% <ø> (+0.46%) ⬆️
bridge-filesystem-async-aws 90.38% <ø> (ø)
bridge-filesystem-azure 89.92% <ø> (ø)
bridge-monolog-http 96.38% <ø> (ø)
symfony-http-foundation 74.41% <ø> (ø)
adapter-chartjs 86.45% <ø> (ø)
adapter-csv 89.57% <ø> (ø)
adapter-doctrine 88.08% <ø> (ø)
adapter-elasticsearch 97.19% <ø> (ø)
adapter-google-sheet 78.04% <ø> (ø)
adapter-http 59.15% <ø> (ø)
adapter-json 90.62% <ø> (ø)
adapter-logger 53.84% <ø> (ø)
adapter-meilisearch 97.75% <ø> (ø)
adapter-parquet 80.85% <ø> (ø)
adapter-text 84.44% <ø> (ø)
adapter-xml 83.15% <ø> (ø)

@norberttech norberttech merged commit 3b3800c into flow-php:1.x Mar 2, 2025
21 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants